proc op {nick chan otbn1 host botnet} {   
  global botnick home bcast

  # Make sure the bot is op'd
  if {![botisop $chan]} {
    putquick "NOTICE $nick :\0034ERROR - Bot dosen't have op status (+o) on $chan"
    return 0
  }  

  # if noone is specified, assume user is talking about themselves
  # if there is no one with the nickname "me" - allow use of the "me" keyword from StormTCL
  if {($otbn1 == "") || ( ![onchan me $chan] && [string tolower $otbn1] == "me" ) } { 
    set otbn1 $nick

    # Make sure user isn't already op'd
    if {[isop $nick $chan]} {
      putquick "NOTICE $nick :\0034ERROR - You are currently op'd on $chan"
      return 0
    }  

    putlog "!$nick ($host)! op $chan $nick"
    putquick "MODE $chan +o $nick"
    putquick "NOTICE $nick :\0033Sucessfully Op'd \0034$nick\0033 in \0034$chan"

    if {$bcast == "1"} {
      putquick "PRIVMSG $home :Op'd \002$nick\002 ($host) In $chan"
    }

    return 0
  }

  if {[isop $botnet $chan]} {
    putquick "NOTICE $nick :\0034ERROR - Already Op'd - $botnet is currently op'd on $chan"
    return 0
  } else {
    if {[onchan $botnet $chan]} {
      putlog "!$nick ($host)! op $chan $botnet"
      pushmode $chan +o $botnet
      putquick "NOTICE $nick :\0033Sucessfully Op'd \0034$botnet\0033 in \0034$chan"

      if {$bcast == "1"} {
        putquick "PRIVMSG $home :Op'd \002$botnet\002 In $chan (Requested By: \002$nick\002 ($host))"
      }

      return 0
    } else {
      putquick "NOTICE $nick :\0034ERROR - $botnet not found on $chan"
    }
  }
}










